<template>
  <view class="page-root">
    <view class="list-item" v-for="(item, index) in list" :key="index" @click="xilie(item.id)">
      <view class="list-name ell1">{{ item.title }}</view>
      <image class="arrow-right" src="/static/arrow-right.png"></image>
    </view>

    <view class="list-item" @click="xilie(0)">
      <view class="list-name ell1">
        <text v-if="lang">Own config</text>
        <text v-else>自己的配置</text>
      </view>
      <image class="arrow-right" src="/static/arrow-right.png"></image>
    </view>

    <view class="list-item" @click="cheyou()">
      <view class="list-name ell1">
        <text v-if="lang">Car enthusiast config</text>
        <text v-else>车友配置</text>
      </view>
      <image class="arrow-right" src="/static/arrow-right.png"></image>
    </view>
  </view>
</template>

<script>
import utils from "@/utils/util.js";
import Tabbar from "@/components/tabbar/tabbar.vue";
import uniPopup from "@/components/uni-popup/uni-popup.vue";
export default {
  components: {
    "view-tabbar": Tabbar,
    uniPopup,
  },
  data() {
    return {
      lang: 0,
      login: true, //是否登录
      userType: 0, //嘉宾状态 0.未申请 1.待审核 2.通过 3.拒绝
      avatar: "", //头像
      nickname: "艾克里里", //昵称
      inviteCode: "", //邀请码

      list: [], //我的报名
      total: 0, //总条数
      page: 1, //当前页数
      nodata: false, //是否有数据
      data: {},
      data_s: {},
    };
  },
  onLoad() {
    this.getList();
  },
  onReachBottom() {
    if (this.list.length < this.total) {
      this.page++;
      this.getList();
    }
  },
  onShow() {
    if (uni.getStorageSync("lang")) {
      this.lang = uni.getStorageSync("lang");
    }
    if (this.lang == 1) {
      uni.setNavigationBarTitle({
        title: "Upgradation",
      });
    } else {
      uni.setNavigationBarTitle({
        title: "软件无限升级",
      });
    }

    this.data = uni.getStorageSync("dev_data");
  },
  methods: {
    cheyou() {
      //读取文件？

      this.daoru();
    },

    daoru(item) {
      let that = this;
      //that.daoru_dea
      uni.showModal({
        title: "是否确认导入",
        // content: '您的位置信息将用获取信息',
        success: (res) => {
          if (res.confirm) {
            that.daoru_dea();
          }
        },
      });
    },
    daoru_dea() {
      let that = this;
      let inifile_path;
      //wx.navigateTo({url: '/pages/showing/showing'})
      wx.chooseMessageFile({
        count: 1,
        type: "file",
        extension: ["ini"],
        success(res) {
          inifile_path = res.tempFiles;
          console.log("chooseMessageFile", inifile_path);

          const fs = wx.getFileSystemManager();
          try {
            let file_res = fs.readFileSync(inifile_path[0].path, "binary", 0);
            that.import_pararm_config(file_res);
          } catch (e) {
            console.error(e);
          }
          that.data.param_read_success_flag = true;
          // that.save_confg();
        },
      });
    },
    import_pararm_config: function (file_res) {
      let that = this;
      let k = 0,
        j,
        n;
      let BUFFERSIZE = 24;
      let RxBuffer = new Uint8Array(24);
      let str = file_res.split("\r\n");
      for (j = 1; j < 8; j++) {
        RxBuffer[4] = j;
        for (n = 5; n < BUFFERSIZE - 2; n++) {
          RxBuffer[n] = parseInt(str[k++]);
        }
        that.funReadPage(RxBuffer);
      }
    } /**/,
    funReadPage(RxBuffer) {
      let that = this;
      console.log("读取页面", RxBuffer);
      var BUFFERSIZE = 24;
      var temp = 0;
      switch (RxBuffer[4]) {
        case 1:
          {
            if (RxBuffer[5] == 0x05) {
              temp = 0;
            } else if (RxBuffer[5] == 0x0a) {
              temp = 1;
            } else if (RxBuffer[5] == 0x14) {
              temp = 2;
            } else if (RxBuffer[5] == 0x1e) {
              temp = 3;
            } else if (RxBuffer[5] == 0x28) {
              temp = 4;
            }
            this.data.pm_type_index = temp;
            this.data.voltage_level_index = RxBuffer[6] & 0xf;
            this.data.manufacturer_code_index = (RxBuffer[6] >> 4) & 0xf;
            this.data.over_voltage_value = ((RxBuffer[7] << 8) | RxBuffer[8]) / 10;
            this.data.under_voltage_value = ((RxBuffer[16] << 8) | RxBuffer[17]) / 10;
            this.data.soft_under_voltage_value = ((RxBuffer[9] << 8) | RxBuffer[10]) / 10;
            this.data.under_voltage_threshold_value = RxBuffer[11] / 10;
            this.data.bus_current_limit_value = (RxBuffer[12] << 8) | RxBuffer[13];
            this.data.phase_current_value = (RxBuffer[14] << 8) | RxBuffer[15];
            this.data.vol_calibration_value = (RxBuffer[18] << 8) | RxBuffer[19];
            this.data.cur_calibration_value = (RxBuffer[20] << 8) | RxBuffer[21];

            // setTimeout(function () {
            // 	 uni.navigateBack({//返回上一个页面
            // 		delta: 1
            // 	 });
            // }, 500);
          }
          break;
        case 2:
          {
            temp = (RxBuffer[5] << 8) | RxBuffer[6];
            this.data.sport_bus_current_limit = temp;

            temp = RxBuffer[7];
            this.data.low_speed_percent = temp;

            temp = RxBuffer[8];
            this.data.mid_speed_percent = temp;

            temp = RxBuffer[9];
            this.data.high_speed_percent = temp;

            temp = (RxBuffer[10] << 8) | RxBuffer[11];
            this.data.flux_weak_value = temp;

            temp = (RxBuffer[12] << 8) | RxBuffer[13];
            this.data.phase_Kp = temp;

            temp = (RxBuffer[14] << 8) | RxBuffer[15];
            this.data.phase_current_limit_value = temp;

            temp = RxBuffer[17];
            this.data.turtle_speed_pecent = temp;

            if ((RxBuffer[16] & 0x80) != 0) {
              //page1.m_soft_start_enable.SetCheck(1);
              this.data.soft_start_flag = true;
            } else {
              //page1.m_soft_start_enable.SetCheck(0);
              this.data.soft_start_flag = false;
            }
            if ((RxBuffer[16] & 0x40) != 0) {
              //page3.m_low_ebreak_enable.SetCheck(1);
              this.data.motor_noise_forbid_falg = true;
            } else {
              //page3.m_low_ebreak_enable.SetCheck(0);
              this.data.motor_noise_forbid_falg = false;
            }
            if ((RxBuffer[16] & 0x20) != 0) {
              //page1.m_self_lock_switch_enable = 1;
              //this.setData({safe_start_enable_flag:true});
            } else {
              //page1.m_self_lock_switch_enable = 0;
              //this.setData({safe_start_enable_flag:false});
            }
            if ((RxBuffer[16] & 0x10) != 0) {
              //page3.m_v_type_flag = 1;
              this.data.motor_type_selcet_value = 2;
            } else {
              //page3.m_v_type_flag = 0;
              this.data.motor_type_selcet_value = 1;
            }
            if ((RxBuffer[16] & 0x20) != 0) {
              //page3.m_v_type_flag = 1;
              this.data.dot_switch_selcet_flag = 2;
            } else {
              //page3.m_v_type_flag = 0;
              this.data.dot_switch_selcet_flag = 1;
            }
            if ((RxBuffer[16] & 0x01) != 0) {
              //page1.m_speed_limit_enable.SetCheck(1);
              this.data.turtle_speed_enable = true;
            } else {
              //page1.m_speed_limit_enable.SetCheck(0);
              this.data.turtle_speed_enable = false;
            }
            if ((RxBuffer[16] & 0x08) != 0) {
              //	page1.m_default_speed_value = 0;
              this.data.default_gear = 1;
            } else if ((RxBuffer[16] & 0x04) != 0) {
              //page1.m_default_speed_value = 1;
              this.data.default_gear = 2;
            } else if ((RxBuffer[16] & 0x02) != 0) {
              //page1.m_default_speed_value = 2;
              this.data.default_gear = 4;
            }
            if (RxBuffer[18] < 17) {
              //page1.m_soft_start_level.SetCurSel(RxBuffer[18] - 1);
              this.data.softstart_level_index = RxBuffer[18] - 1;
            } else {
              this.data.softstart_level_index = 0;
            }
            console.log(RxBuffer[18]);
            //page1.m_boost_time_limit_value = (RxBuffer[19]);
            this.data.sport_quit_time = RxBuffer[19];

            //page1.m_boost_time_recover_value = (RxBuffer[20]);
            this.data.sport_recover_time = RxBuffer[20];
            //page1.m_flux_weak_param_value = RxBuffer[21];
            this.data.flux_weak_compensate = RxBuffer[21];
            console.log("页面2读取完成");
          }
          break;
        case 3:
          {
            temp = (RxBuffer[5] << 8) | RxBuffer[6];
            //page3.m_hall_shift_value = temp;
            let value = new Int16Array(1);
            value[0] = temp;
            this.data.motor_shift_angle = value[0];
            //page3.m_start_tempretrue_protect_value = RxBuffer[7];
            this.data.start_tempretrue_protect_value = RxBuffer[7];
            //page3.m_over_temperetrue_protect_value = RxBuffer[8];
            this.data.over_temperetrue_protect_value = RxBuffer[8];
            //page3.m_max_tempretrue_protect_value = RxBuffer[9];
            this.data.max_tempretrue_protect_value = RxBuffer[9];
            temp = (RxBuffer[10] << 8) | RxBuffer[11];
            //page3.m_tempretrue_fact1 = temp;
            this.data.tempretrue_fact = temp;
            temp = (RxBuffer[12] << 8) | RxBuffer[13];
            //page3.m_tempretrue_fact2 = temp;
            this.data.adj_fact1 = temp;
            temp = (RxBuffer[14] << 8) | RxBuffer[15];
            //page3.m_tempretrue_fact3 = temp;
            this.data.adj_fact2 = temp;
            if ((RxBuffer[17] & 0x80) != 0) {
              this.data.set_motor_dir = 2;
            } else {
              this.data.set_motor_dir = 1;
            }
            if ((RxBuffer[17] & 0x40) != 0) {
              //	page1.m_sport_auto_quit_enable.SetCheck(1);
              this.data.sport_auto_quit_enable = true;
            } else {
              //page1.m_sport_auto_quit_enable.SetCheck(0);
              this.data.sport_auto_quit_enable = false;
            }
            if ((RxBuffer[17] & 0x20) != 0) {
              //page3.m_hall_changed.SetCheck(1);
              this.data.exchange_hall_flag = true;
            } else {
              //page3.m_hall_changed.SetCheck(0);
              this.data.exchange_hall_flag = false;
            }
            if ((RxBuffer[17] & 0x10) != 0) {
              //page3.m_phase_changed.SetCheck(1);
              this.data.exchange_motor_phase_flag = true;
            } else {
              //page3.m_phase_changed.SetCheck(0);
              this.data.exchange_motor_phase_flag = false;
            }
            if ((RxBuffer[17] & 0x08) != 0) {
              //page1.m_park_enalbe.SetCheck(1);
              this.data.auto_park_enable = true;
            } else {
              //page1.m_park_enalbe.SetCheck(0);
              this.data.auto_park_enable = false;
            }
            //	page3.m_reverse_speed_limit_value = RxBuffer[16];
            this.data.reverse_speed_limit_percent = RxBuffer[16];

            //page3.m_motor_pair = RxBuffer[18];
            this.data.motor_pole_pair = RxBuffer[18];
            //page3.m_ebs_value = RxBuffer[19];
            this.data.ebs_percent = RxBuffer[19];
            //page0.m_software_vision = RxBuffer[20];
            //page0.m_software_vision /= 100;
            this.data.software_vision = RxBuffer[20] / 100;
            //page0.m_hardware_vision = RxBuffer[21];
            //page0.m_hardware_vision /= 100;
            this.data.m_hardware_vision = RxBuffer[21] / 100;
            console.log("页面3读取完成");
          }
          break;
        case 4:
          {
            if ((RxBuffer[5] & 0x01) != 0) {
              //page3.m_aux_torque_enable.SetCheck(1);
              this.data.aux_move_enable_flag = true;
            } else {
              //page3.m_aux_torque_enable.SetCheck(0);
              this.data.aux_move_enable_flag = false;
            }
            if ((RxBuffer[5] & 0x02) != 0) {
              //page1.m_hill_down_enalbe.SetCheck(1);
              this.data.max_speed_limit_enable = true;
            } else {
              //page1.m_hill_down_enalbe.SetCheck(0);
              this.data.max_speed_limit_enable = false;
            }
            if ((RxBuffer[5] & 0x04) != 0) {
              //page3.m_output_select_flag = 0;
              this.data.output_type_selcet_value = 1;
            } else {
              //page3.m_output_select_flag = 1;
              this.data.output_type_selcet_value = 2;
            }
            if ((RxBuffer[5] & 0x08) != 0) {
              //page3.m_cruise_enable.SetCheck(1);
              this.data.cruise_enable_flag = true;
            } else {
              //page3.m_cruise_enable.SetCheck(0);
              this.data.cruise_enable_flag = false;
            }
            if ((RxBuffer[5] & 0x10) != 0) {
              //page3.m_double_voltage_enable.SetCheck(1);
              this.data.double_voltage_enable = true;
            } else {
              //page3.m_double_voltage_enable.SetCheck(0);
              this.data.double_voltage_enable = false;
            }
            if ((RxBuffer[5] & 0x20) != 0) {
              //page3.m_double_voltage_select = true;
              this.data.double_voltage_value = 2;
            } else {
              //page3.m_double_voltage_select = false;
              this.data.double_voltage_value = 1;
            }
            if ((RxBuffer[5] & 0x40) != 0) {
              //page3.m_safe_start_vaild.SetCheck(1);
              this.data.safe_start_enable_flag = true;
            } else {
              //page3.m_safe_start_vaild.SetCheck(0);
              this.data.safe_start_enable_flag = false;
            }
            temp = (RxBuffer[8] << 8) | RxBuffer[9];
            //page3.m_aux_torque_limit_value = temp;
            this.data.aux_torque_limit_value = temp;
            temp = (RxBuffer[6] << 8) | RxBuffer[7];
            //page3.m_aux_speed_limit_value = ((temp * 100 + 99) / 32768);
            this.data.aux_speed_limit_percent = (temp * 100 + 99) / 32768;

            temp = (RxBuffer[10] << 8) | RxBuffer[11];
            //page1.m_DH_SP_VALUE = temp;
            this.data.max_speed_limit_value = temp;

            temp = RxBuffer[12];
            //page1.m_h_egear_1_value = temp;
            this.data.low_speed_limit_current_percet = temp;

            temp = RxBuffer[13];
            //page1.m_h_egear_2_value = temp;
            this.data.mid_speed_limit_current_percet = temp;

            temp = RxBuffer[14];
            //page1.m_h_egear_3_value = temp;
            this.data.over_module_percent = temp;

            temp = (RxBuffer[15] << 8) | RxBuffer[16];
            //page1.m_h_s_gear_flux_weak_value = temp;
            this.data.phase_Ki = temp;

            temp = (RxBuffer[17] << 8) | RxBuffer[18];
            //page1.m_h_egear_3_flux_weak_value = temp;
            this.data.rated_phase_current_value = temp;

            temp = (RxBuffer[19] << 8) | RxBuffer[20];
            //page1.m_h_egear_2_flux_weak_value = temp;
            this.data.rated_phase_current_limit_time = temp;
            console.log("页面4读取完成");
          }
          break;
        case 5:
          {
            /*union_IO_setup temp});
			          for (let i:0}); i<8}); i++)
			          {
			            temp.IO_setup_byte:(RxBuffer[5 + i * 2] << 8 | RxBuffer[6 + i * 2])});
			            (CComboBox *)(*ptr_function_list_tab[i]).SetCurSel(temp.IO_setup_bit.function)});
			            *ptr_input_status_value_tab[i]:temp.IO_setup_bit.input_status_set});
			            (*ptr_input_select_tab[i]).SetCheck(temp.IO_setup_bit.input_output)});
			            (*ptr_SW_select_tab[i]).SetCheck(temp.IO_setup_bit.switch_butten)});
			            (*ptr_low_active_select_tab[i]).SetCheck(temp.IO_setup_bit.active_low)});
			          }*/
            let i = 0;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index0 = temp & 0x7f;
            this.data.function_select_radiobox0 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox0 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index1 = temp & 0x7f;
            this.data.function_select_radiobox1 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox1 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index2 = temp & 0x7f;
            this.data.function_select_radiobox2 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox2 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index3 = temp & 0x7f;
            this.data.function_select_radiobox3 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox3 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index4 = temp & 0x7f;
            this.data.function_select_radiobox4 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox4 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index5 = temp & 0x7f;
            this.data.function_select_radiobox5 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox5 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index6 = temp & 0x7f;
            this.data.function_select_radiobox6 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox6 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + i * 2] << 8) | RxBuffer[6 + i * 2];
            this.data.function_select_index7 = temp & 0x7f;
            this.data.function_select_radiobox7 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox7 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            //flux_weak_calibration_value:RxBuffer[21]});
            this.data.flux_weak_calibration_value = RxBuffer[21];
            console.log("页面5读取完成");
          }
          break;
        case 6:
          {
            /*union_IO_setup temp});
			  
			          for (int i:8}); i<16}); i++)
			          {
			            temp.IO_setup_byte:(RxBuffer[5 + (i - 8) * 2] << 8 | RxBuffer[6 + (i - 8) * 2])});
			            (CComboBox *)(*ptr_function_list_tab[i]).SetCurSel(temp.IO_setup_bit.function)});
			            *ptr_input_status_value_tab[i]:temp.IO_setup_bit.input_status_set});
			            (*ptr_input_select_tab[i]).SetCheck(temp.IO_setup_bit.input_output)});
			            (*ptr_SW_select_tab[i]).SetCheck(temp.IO_setup_bit.switch_butten)});
			            (*ptr_low_active_select_tab[i]).SetCheck(temp.IO_setup_bit.active_low)});
			          }
			  
			          _m_can_burad:RxBuffer[21] >> 4});
			          _m_can_ID:RxBuffer[21] & 0xf});
			          for (int i:5}); i<BUFFERSIZE - 2}); i++)
			          {
			            page5_tx_message[i]&0xff):RxBuffer[i]});
			          }*/
            let i = 8;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index8 = temp & 0x7f;
            this.data.function_select_radiobox8 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox8 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index9 = temp & 0x7f;
            this.data.function_select_radiobox9 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox9 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index10 = temp & 0x7f;
            this.data.function_select_radiobox10 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox10 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index11 = temp & 0x7f;
            this.data.function_select_radiobox11 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox11 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index12 = temp & 0x7f;
            this.data.function_select_radiobox12 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox12 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index13 = temp & 0x7f;
            this.data.function_select_radiobox13 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox13 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index14 = temp & 0x7f;
            this.data.function_select_radiobox14 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox14 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            i++;
            temp = (RxBuffer[5 + (i - 8) * 2] << 8) | RxBuffer[6 + (i - 8) * 2];
            this.data.function_select_index15 = temp & 0x7f;
            this.data.function_select_radiobox15 = 1 << ((temp >> 9) & 0x03);
            this.data.function_select_checkbox15 = ((temp >> 7) & 0x03) + ((temp >> 9) & 0x04);
            console.log("页面6读取完成");
          }
          break;
        case 7:
          {
            //page0.m_footplat_start_value = floor((RxBuffer[5] * 550 / 255) + 2.2) / 100;
            this.data.footplat_start_value = Math.floor((RxBuffer[5] * 550) / 255 + 2.2) / 100;
            //page0.m_footplat_end_value = floor((RxBuffer[6] * 550 / 255) + 2.2) / 100;
            this.data.footplat_end_value = Math.floor((RxBuffer[6] * 550) / 255 + 2.2) / 100;
            //page0.m_footplat_low_protect_value = floor((RxBuffer[7] * 550 / 255) + 2.2) / 100;
            this.data.footplat_low_protect_value = Math.floor((RxBuffer[7] * 550) / 255 + 2.2) / 100;
            //page0.m_footplat_high_protect_value = floor((RxBuffer[8] * 550 / 255) + 2.2) / 100;
            this.data.footplat_high_protect_value = Math.floor((RxBuffer[8] * 550) / 255 + 2.2) / 100;
            //page0.m_sink_ratio = RxBuffer[9];
            this.data.sink_ratio = RxBuffer[9];
            //page0.m_rise_ratio = RxBuffer[10];
            this.data.rise_ratio = RxBuffer[10];
            //page0.m_start_torque = (RxBuffer[11] << 8 | RxBuffer[12]);
            this.data.start_torque = (RxBuffer[11] << 8) | RxBuffer[12];
            //page0.m_combine_torque = (RxBuffer[13] << 8 | RxBuffer[14]);
            this.data.combine_torque = (RxBuffer[13] << 8) | RxBuffer[14];
            //calibration_value_show_flag = true;
            console.log("页面7读取完成");

            uni.setStorageSync("lan_bug", 0);
            uni.hideLoading();
            that.zhuanhuan();
            console.log(that.data, 55555557);
          }
          break;
        default:
          console.log("未知页面！！！11");
          break;
      }
    },

    goDetail(url) {
      uni.navigateTo({
        url: url,
      });
    },
    zhuanhuan() {
      let that = this;
      // that.data.soft_start_flag = that.data.soft_start_flag==1?true:false

      // that.data.soft_start_flag = that.data.soft_start_flag==1?true:false
      // that.data.max_speed_limit_enable = that.data.max_speed_limit_enable==1?true:false
      // that.data.auto_park_enable = that.data.auto_park_enable==1?true:false
      // that.data.turtle_speed_enable = that.data.turtle_speed_enable==1?true:false
      // that.data.sport_auto_quit_enable = that.data.sport_auto_quit_enable==1?true:false

      // that.data.exchange_hall_flag = that.data.exchange_hall_flag==1?true:false
      // that.data.exchange_motor_phase_flag = that.data.exchange_motor_phase_flag == 1?true:false

      // that.data.aux_move_enable_flag = that.data.aux_move_enable_flag==1?true:false
      // that.data.double_voltage_enable = that.data.double_voltage_enable==1?true:false

      // that.data.motor_noise_forbid_falg = that.data.motor_noise_forbid_falg==1?true:false
      // that.data.safe_start_enable_flag = that.data.safe_start_enable_flag==1?true:false
      // that.data.cruise_enable_flag = that.data.cruise_enable_flag==1?true:false

      // that.data.set_motor_dir = Number(that.data.set_motor_dir)
      // that.data.motor_type_selcet_value = Number(that.data.motor_type_selcet_value);
      // that.data.output_type_selcet_value = Number(that.data.output_type_selcet_value);
      // that.data.double_voltage_value = Number(that.data.double_voltage_value)

      // that.data.dot_switch_selcet_flag = Number(that.data.double_voltage_value)
      // that.data.default_gear = Number(that.data.default_gear);

      // that.data.function_select_checkbox0 = Number(that.data.function_select_checkbox0);
      // that.data.function_select_checkbox1 = Number(that.data.function_select_checkbox1);
      // that.data.function_select_checkbox2 = Number(that.data.function_select_checkbox2);
      // that.data.function_select_checkbox3 = Number(that.data.function_select_checkbox3);
      // that.data.function_select_checkbox4 = Number(that.data.function_select_checkbox4);
      // that.data.function_select_checkbox5 = Number(that.data.function_select_checkbox5);
      // that.data.function_select_checkbox6 = Number(that.data.function_select_checkbox6);
      // that.data.function_select_checkbox7 = Number(that.data.function_select_checkbox7);
      // that.data.function_select_checkbox8 = Number(that.data.function_select_checkbox8);
      // that.data.function_select_checkbox9 = Number(that.data.function_select_checkbox9);
      // that.data.function_select_checkbox10 = Number(that.data.function_select_checkbox10);
      // that.data.function_select_checkbox11 = Number(that.data.function_select_checkbox11);
      // that.data.function_select_checkbox12 = Number(that.data.function_select_checkbox12);
      // that.data.function_select_checkbox13 = Number(that.data.function_select_checkbox13);
      // that.data.function_select_checkbox14 = Number(that.data.function_select_checkbox14);
      // that.data.function_select_checkbox15 = Number(that.data.function_select_checkbox15);

      // that.data.function_select_index0 = Number(that.data.function_select_index0);
      // that.data.function_select_index1 = Number(that.data.function_select_index1);
      // that.data.function_select_index2 = Number(that.data.function_select_index2);
      // that.data.function_select_index3 = Number(that.data.function_select_index3);
      // that.data.function_select_index4 = Number(that.data.function_select_index4);
      // that.data.function_select_index5 = Number(that.data.function_select_index5);
      // that.data.function_select_index6 = Number(that.data.function_select_index6);
      // that.data.function_select_index7 = Number(that.data.function_select_index7);
      // that.data.function_select_index8 = Number(that.data.function_select_index8);
      // that.data.function_select_index9 = Number(that.data.function_select_index9);
      // that.data.function_select_index10 = Number(that.data.function_select_index10);
      // that.data.function_select_index11 = Number(that.data.function_select_index11);
      // that.data.function_select_index12 = Number(that.data.function_select_index12);
      // that.data.function_select_index13 = Number(that.data.function_select_index13);
      // that.data.function_select_index14 = Number(that.data.function_select_index14);
      // that.data.function_select_index15 = Number(that.data.function_select_index15);

      // that.data.function_select_radiobox0 = Number(that.data.function_select_radiobox0);
      // that.data.function_select_radiobox1 = Number(that.data.function_select_radiobox1);
      // that.data.function_select_radiobox2 = Number(that.data.function_select_radiobox2);
      // that.data.function_select_radiobox3 = Number(that.data.function_select_radiobox3);
      // that.data.function_select_radiobox4 = Number(that.data.function_select_radiobox4);
      // that.data.function_select_radiobox5 = Number(that.data.function_select_radiobox5);
      // that.data.function_select_radiobox6 = Number(that.data.function_select_radiobox6);
      // that.data.function_select_radiobox7 = Number(that.data.function_select_radiobox7);
      // that.data.function_select_radiobox8 = Number(that.data.function_select_radiobox8);
      // that.data.function_select_radiobox9 = Number(that.data.function_select_radiobox9);
      // that.data.function_select_radiobox10 = Number(that.data.function_select_radiobox10);
      // that.data.function_select_radiobox11 = Number(that.data.function_select_radiobox11);
      // that.data.function_select_radiobox12 = Number(that.data.function_select_radiobox12);
      // that.data.function_select_radiobox13 = Number(that.data.function_select_radiobox13);
      // that.data.function_select_radiobox14 = Number(that.data.function_select_radiobox14);
      // that.data.function_select_radiobox15 = Number(that.data.function_select_radiobox15);

      console.log("开始导入", that.data, 777777777777777);

      uni.setStorageSync("dev_data", that.data);
      uni.setStorageSync("lan_bug", that.data.lan_bug);

      //其他信息不能覆盖

      // uni.setStorageSync('deviceInfo',that.data.deviceInfo)
      // uni.setStorageSync('serviceInfo',that.data.serviceInfo)
      uni.showToast({ title: "导入成功" });
    },
    getList() {
      let _this = this;
      this.$api.request(
        "/api/index/getxilie",
        {
          page: this.page,
        },
        this.$store.state.token,
        function (res) {
          if (res.code == 1) {
            if (_this.page == 1) {
              _this.list = res.data.data;
            } else {
              _this.list = _this.list.concat(res.data.data);
            }
            _this.total = res.data.total_item_count;
            if (_this.list.length > 0) {
              _this.nodata = false;
            } else {
              _this.nodata = true;
            }
          }
        }
      );
    },
    xilie(id) {
      uni.navigateTo({
        url: "/pagesB/mine/index/xilie?id=" + id,
      });
    },
  },
};
</script>

<style>
page {
  background: #19253e;
}
</style>

<style lang="scss" scoped>
.page-root {
  padding-bottom: 20rpx;
}
.list-item {
  display: flex;
  align-items: center;
  font-style: 32rpx;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10rpx;
  color: #fff;
  padding: 20rpx;
  margin: 20rpx 30rpx 0;
  .list-name {
    flex: 1;
  }
  .arrow-right {
    width: 32rpx;
    height: 32rpx;
    margin-left: 20rpx;
  }
}
</style>
